#include "mainwindow_game1.h"
#include "ui_mainwindow_game1.h"

MainWindow_game1::MainWindow_game1(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow_game1)
{
//    ui->setupUi(this);
//    backtomenu->setParent(this);
//    backtomenu->setGeometry(0,0,80,35);
//    backtomenu->show();
//    connect(backtomenu,&QPushButton::clicked,[=](){
//        this->hide();
//        this->BACK->show();
//    });


    //加载游戏一界面
    game1_scene();

}

MainWindow_game1::~MainWindow_game1()
{
    delete ui;

}

void MainWindow_game1::game1_scene()
{
    //设置窗口尺寸（固定）
    setFixedSize(GAME_WIDTH,GAME_HEIGHT);
    //标题
    setWindowTitle(GAME1_TITLE);
    //窗口图标
    setWindowIcon(QIcon(GAME_Icon));





}

void MainWindow_game1::paintEvent(QPaintEvent *)
{
    QPainter painter(this);
    painter.drawPixmap(m_map2.m_map1_posx,m_map2.m_map1_posy,m_map2.m_map1_2);//  尝试绘制地图场景
}
